package net.aiion.weave.impl.bytecode.events;

import net.aiion.weave.spi.bytecode.BytecodeVisitor;
import net.aiion.weave.spi.bytecode.events.FieldStartBytecodeEvent;

public class FieldStartBytecodeEventImpl extends BytecodeEventImpl implements FieldStartBytecodeEvent
{
    private int modifiers;
    private String name;
    private String descriptor;
    private String signature;
    private Object constantValue;

    public FieldStartBytecodeEventImpl(final int aModifiers, final String aName, final String aDescriptor,
        final String aSignature, final Object aConstantValue)
    {
        modifiers = aModifiers;
        name = aName;
        descriptor = aDescriptor;
        signature = aSignature;
        constantValue = aConstantValue;
    }

    @Override
    public int getType() {
        return FIELD_START;
    }

    @Override
    public void setModifiers(final int aModifiers) {
        modifiers = aModifiers;
    }

    @Override
    public int getModifiers() {
        return modifiers;
    }

    @Override
    public void setName(final String aName) {
        name = aName;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public void setDescriptor(final String aDescriptor) {
        descriptor = aDescriptor;
    }

    @Override
    public String getDescriptor() {
        return descriptor;
    }

    @Override
    public void setSignature(final String aSignature) {
        signature = aSignature;
    }

    @Override
    public String getSignature() {
        return signature;
    }

    @Override
    public void setConstantValue(final Object aConstantValue) {
        constantValue = aConstantValue;
    }

    @Override
    public Object getConstantValue() {
        return constantValue;
    }

    @Override
    public BytecodeVisitor acceptBytecodeVisitor(final BytecodeVisitor aBytecodeVisitor) {
        return aBytecodeVisitor.asBytecodeClassVisitor().visitFieldStart(this);
    }
}
